package com.joelaws.prototype.client.rpc;

import java.util.Map;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import com.joelaws.prototype.client.data.User;

public interface Manage extends RemoteService {

	public static final String SERVICE_URI = "/Manage";

	public static class Util {

		public static ManageAsync getInstance() {

			ManageAsync instance = (ManageAsync) GWT.create(Manage.class);
			ServiceDefTarget target = (ServiceDefTarget) instance;
			target.setServiceEntryPoint(GWT.getModuleBaseURL() + SERVICE_URI);
			return instance;
		}
	}

	public User getUser(long userID) throws Exception;

	public Map<Long, User> getUsers(long[] userIDs) throws Exception;

	public User login(String email, String password) throws Exception;

	public User register(String email, String firstName, String lastName, String password) throws Exception;

	public void updateUser(User user) throws Exception;
}
